package com.ss.web.tagmark.entity;

import org.apache.commons.lang3.StringUtils;

/**
 * 文章的每个字信息
 * 
 * @author Administrator
 *
 */
public class ArticleChar {
	public static final String IDX_TAG = "d";
	private int idx;
	/** 额外信息 */
	private String extra;
	private char ch;

	public int getIdx() {
		return idx;
	}

	public void setIdx(int idx) {
		this.idx = idx;
	}

	public char getCh() {
		return ch;
	}

	public void setCh(char ch) {
		this.ch = ch;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder(StringUtils.defaultString(getExtra()));
		sb.append("<" + IDX_TAG + " offset='");
		sb.append(idx);
		sb.append("'>");
		sb.append(getCh());
		sb.append("</" + IDX_TAG + ">");
		return sb.toString();
	}

	public String getExtra() {
		return extra;
	}

	public void setExtra(String extra) {
		this.extra = extra;
	}
}
